<template>
  <div class="ebook">
    <div  class="tzc_sy_bookshelf_b" v-for="(item, i) in data.data" :key="i">
      <router-link v-if="item.type == 'EPUB'" :to="'/ebook' + item.guid">
        <img :src="item.pic" alt="" srcset="" />
        <div>{{ item.title }}</div>
      </router-link>
      <router-link v-else-if="item.type == 'PDF'" :to="'/epdf' + item.guid">
        <img :src="item.pic" alt="" srcset="" />
        <div>{{ item.title }}</div>
      </router-link>
    </div>
  </div>
</template>

<script>
import { articlelist } from "@/api/api";
export default {
  props: {
    mydata: {},
    NextDATA: {},
    mypp:{}
  },
  data() {
    return {
      data: {
      },
      query2:{}
    };
  },
  watch: {
    mypp(nvv){
      this.PostFYlist(nvv); 
    }
  },
  methods: {
    // 分页数据方法
    PostFYlist(index) {
      // let query = {
      //   pagesize: 7,
      //   page: this.mydata,
      //   mguid: this.mypp.mguid,
      // };
      this.query2 = this.mypp; 
      this.query2.page = this.mydata;
      // console.log("this.query2",this.query2);
      articlelist(this.query2)
        .then((res) => {
          // console.log("SS",res.data.mydata);
          this.data = res.data.mydata;
        })
        .catch((err) => {
          console.log(err);
        });
    },
  },
  mounted() {
    // console.log("mounted1",this.mydata);
    // console.log("mounted2",this.mypp);
    this.data = {};
    this.PostFYlist();
    if (window.localStorage.getItem("isKong")==1) {
        //this.PostFYlist(this.NextDATA.key)
    }
  },
};
</script>

<style lang="scss" scoped>
.tzc_sy_bookshelf {
  margin: 0 auto;
  margin-top: 6rem;
  width: 94%;
  height: auto;
  z-index: 99;
  .tzc_sy_bookshelf_b {
    z-index: 100;
    width: 10%;
    height: 4rem;
    float: left;
    padding-left: 1.25%;
    padding-right: 1.25%;
    margin-top: -40px;
    background: url(../assets/image/tzc_mj_2.png) no-repeat;
    background-size: 100% auto;
    // clear: both;
    a {
      text-decoration: none;
    }
    img {
      width: 90%;
      height: auto;
      margin-left: 5%;
      margin-top: -190%;
    }
    div {
      width: 100%;
      text-align: center;
      font-size: 16px;
      color: white;
      text-decoration: none;
    }
  }
}
</style>
